#!usr/bin/env python
#coding=utf8

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from tuangou.config import PROJECT_NAME

urlpatterns = patterns('%s.web.admin.views' % PROJECT_NAME,

    url(r'^index/?$', 'index', name='admin-index'),

    url(r'^product/index/?$', 'product_index', name='admin-product-index'),
    url(r'^product/add/?$', 'product_add_view', name='admin-product-add'),
    url(r'^product/add/save/json/?$', 'product_add_save_json', name='admin-product-add-save-json'),
                       
    url(r'^product/edit/(?P<product_id>\d+)/?$', 'product_edit_view', name='admin-product-edit'),
    url(r'^product/edit/save/(?P<product_id>\d+)/?$', 'product_edit_save_json', name='admin-product-edit-save'),
    url(r'^product/edit/savefile/(?P<product_id>\d+)/?$', 'product_edit_save_file', name='admin-product-edit-save-file'),
                       
    url(r'^product/delete/(?P<product_id>\d+)/?$', 'product_delete_json', name='admin-product-delete'),
    url(r'^product/delete/image/(?P<image_id>\d+)/?$', 'product_delete_item_file', name='admin-product-delete-image'),

    url(r'^category/index/?$', 'category_index', name='admin-category-index'),
    url(r'^category/add/?$', 'category_add_view', name='admin-category-add'),
    url(r'^category/add/json/?$', 'category_add_json', name='admin-category-add-json'),
    url(r'^category/edit/view/(?P<category_id>\d+)/?$', 'category_edit_view', name='admin-category-edit-view'),
    url(r'^category/edit/json/(?P<category_id>\d+)/?$', 'category_edit_json', name='admin-category-edit-json'),
    url(r'^category/delete/json/(?P<category_id>\d+)/?$', 'category_delete_json', name='admin-category-delete-json'),

    url(r'^supply/index/?$', 'supply_index', name='admin-supply-index'),
    url(r'^supply/add/(?P<supply_id>\d+)/?$', 'supply_add_view', name='admin-supply-add'),
    url(r'^supply/add/save/json/(?P<supply_id>\d+)/?$', 'supply_add_save_json', name='admin-supply-add-save-json'),  
    url(r'^supply/delete/json/(?P<supply_id>\d+)/?$', 'supply_delete_json', name='admin-supply-delete-json'),
    url(r'^supply/product/(?P<supply_id>\d+)/?$', 'supply_product_index', name='admin-supply-product-index'),

    url(r'^tuangou/index/(?P<product_id>\d+)/?$', 'tuangou_index', name='admin-tuangou-index'),
    url(r'^tuangou/delete/json/(?P<tuangou_id>\d+)/?$', 'tuangou_delete_json', name='admin-tuangou-delete-json'),
    url(r'^tuangou/add/(?P<product_id>\d+)/(?P<tuangou_id>\d+)/?$', 'tuangou_add_view', name='admin-tuangou-add'),
    url(r'^tuangou/add/save/json/(?P<tuangou_id>\d+)/?$', 'tuangou_add_save_json', name='admin-tuangou-add-save-json'), 


    url(r'^hotproduct/index/?$', 'hotproduct_index', name='admin-hotproduct-index'),
    url(r'^hotproduct/edit/(?P<id>\d+)/?$', 'hotproduct_edit_view', name='admin-hotproduct-edit'),
    url(r'^hotproduct/edit/save/(?P<id>\d+)/?$', 'hotproduct_edit_save_json', name='admin-hotproduct-edit-save'), 
    url(r'^hotproduct/delete/(?P<id>\d+)/?$', 'hotproduct_delete_json', name='admin-hotproduct-delete'),  
    url(r'^hotproduct/select/?$', 'hotproduct_select_view', name='admin-hotproduct-select'),   
    url(r'^hotproduct/add/(?P<product_id>\d+)/?$', 'hotproduct_add_json', name='admin-hotproduct-add'),

    url(r'^feedback/index/?$', 'feedback_index', name='admin-feedback-index'),
    url(r'^feedback/delete/json/(?P<feedback_id>\d+)/?$', 'feedback_delete_json', name='admin-feedback-delete-json'),
                       
    url(r'^appform/index/?$', 'appform_index', name='admin-appform-index'),
    url(r'^appform/delete/json/(?P<appform_id>\d+)/?$', 'appform_delete_json', name='admin-appform-delete-json'),

    url(r'^siteinfo/about_edit/?$', 'about_edit', name='admin-about-edit'), 
    url(r'^siteinfo/joinus_edit/?$', 'joinus_edit', name='admin-joinus-edit'),
    url(r'^siteinfo/contactus_edit/?$', 'contactus_edit', name='admin-contactus-edit'),  
    url(r'^siteinfo/companyimg_edit/?$', 'companyimg_edit', name='admin-companyimg-edit'),

    url(r'^cooperationplatform/index/?$', 'cooperationplatform_index', name='admin-cooperationplatform-index'),
    url(r'^cooperationplatform/add/?$', 'cooperationplatform_add', name='admin-cooperationplatform-add'),
    url(r'^cooperationplatform/edit/(?P<id>\d+)/?$', 'cooperationplatform_edit', name='admin-cooperationplatform-edit'),
    url(r'^cooperationplatform/delete/(?P<id>\d+)/?$', 'cooperationplatform_delete_json', name='admin-cooperationplatform-delete'),
                       
    url(r'^cooperationbrand/index/?$', 'cooperationbrand_index', name='admin-cooperationbrand-index'),
    url(r'^cooperationbrand/add/?$', 'cooperationbrand_add', name='admin-cooperationbrand-add'),
    url(r'^cooperationbrand/edit/(?P<id>\d+)/?$', 'cooperationbrand_edit', name='admin-cooperationbrand-edit'),
    url(r'^cooperationbrand/delete/(?P<id>\d+)/?$', 'cooperationbrand_delete_json', name='admin-cooperationbrand-delete'),                      
)
